package ae.pcfc.cldos.online.common.clddb.dao.provider;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import ae.pcfc.cldos.online.common.clddb.dao.ServiceMasterDAO;
import ae.pcfc.cldos.online.common.clddb.domain.ServiceMaster;
import ae.pcfc.cldos.online.common.dao.GenericDAO;

/**
 * 
 * @author arosa
 *
 */
@Repository
public class ServiceMasterDAOImpl extends GenericDAO implements ServiceMasterDAO{
	
	public ServiceMaster findServiceMasterByName(String name){
		DetachedCriteria criteria = DetachedCriteria.forClass(ServiceMaster.class);
		criteria.add(Restrictions.eq(ServiceMaster.__SERVICE_NAME, name).ignoreCase());
		return (ServiceMaster)findByCriteria(criteria);
	}
	
	public ServiceMaster findById(Long serviceId){
		return findById(ServiceMaster.class, serviceId);
	}
	
}
